import * as React from 'react';
import {useState} from 'react';
// import {Prompt} from "react-router-dom";
import {usePrompt} from "./propmtFun";
export const PromptDemo = () => {
    const [count, setCount] = useState(0);
    const changeValue = (e) => {

        setCount(e.target.value);
    }
    return (
        <div>
            我的输入: <input value={count} type="text"
                             onChange={changeValue}/>

            {/*/!*<Prompt when={!!this.state.count} message={'确定要离开吗'}></Prompt>*!/ v5的写法*/}

        </div>
    );
};
